package pro.spring.inter;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import pro.spring.model.Theme;

public interface ThemeMapper {
    int deleteByPrimaryKey(Integer thId);

    int insert(Theme record);

    int insertSelective(Theme record);

    Theme selectByPrimaryKey(Integer thId);

    int updateByPrimaryKeySelective(Theme record);

    int updateByPrimaryKey(Theme record);
    
    //得到总条数
    Integer selectCount();
    
    //检查主题区的name是否已存在
    Integer selectName(@Param("name")String name);
    
    //得到我的主题区的数量
    Integer selectCountByUid(@Param("uId")Integer uid);
    
    //得到最新id
    Integer selectByNew();
    
    //分页查询
    List<Theme> selectListPage(@Param("offset")Integer offset,@Param("pagesize")Integer pagesize);
    
    //分页查询 by key began
    List<Theme> selectListByKey(@Param("key")String key,@Param("offset")Integer offset,@Param("pagesize")Integer pagesize);
    Integer selectByKey(@Param("key")String key);
    //分页查询 by key end
    
    //分页查询 by user
    List<Theme> selectListUser(@Param("uId")Integer uId,@Param("offset")Integer offset,@Param("pagesize")Integer pagesize);
}